package UserInterface;

import java.awt.Color;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;

import java.awt.Font;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.LayoutStyle.ComponentPlacement;

public class GetMoneyFinish extends JPanel {
	private JLabel lblSum;
	private JLabel labelBalance;
	private JButton btnOk;
	public void putSum(String sum){
		lblSum.setText(sum);
	}
	public void putBalance(String balance){
		labelBalance.setText(balance);
	}
	public void addOkListener(ActionListener list){
		btnOk.addActionListener(list);
	}
	
	/**
	 * Create the panel.
	 */
	public GetMoneyFinish() {
		setBackground(new Color(255, 248, 220));
		this.setSize(500, 500);
		
		JLabel lblGetYourMoney = new JLabel("Get your money :");
		lblGetYourMoney.setForeground(new Color(128, 0, 0));
		lblGetYourMoney.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 18));
		
		 lblSum = new JLabel("");
		lblSum.setFont(new Font("Arial", Font.BOLD, 18));
		
		JLabel lblYourBalance = new JLabel("Your Balance:");
		lblYourBalance.setForeground(new Color(128, 0, 0));
		lblYourBalance.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 18));
		
		 labelBalance = new JLabel("");
		labelBalance.setFont(new Font("Arial", Font.BOLD, 18));
		
		 btnOk = new JButton("Ok");
		btnOk.setFont(new Font("Tahoma", Font.BOLD, 14));
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(25)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblGetYourMoney)
							.addGap(77)
							.addComponent(lblSum))
						.addGroup(groupLayout.createSequentialGroup()
							.addComponent(lblYourBalance, GroupLayout.PREFERRED_SIZE, 148, GroupLayout.PREFERRED_SIZE)
							.addGap(77)
							.addComponent(labelBalance, GroupLayout.PREFERRED_SIZE, 172, GroupLayout.PREFERRED_SIZE)))
					.addContainerGap(78, Short.MAX_VALUE))
				.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
					.addContainerGap(172, Short.MAX_VALUE)
					.addComponent(btnOk, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE)
					.addGap(164))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
					.addContainerGap(118, Short.MAX_VALUE)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblGetYourMoney)
						.addComponent(lblSum))
					.addGap(92)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(lblYourBalance, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
						.addComponent(labelBalance, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE))
					.addGap(123)
					.addComponent(btnOk, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
					.addGap(89))
		);
		setLayout(groupLayout);
	}

}
